//package com.choupin.choupin.config;
//
//import com.choupin.choupin.interceptor.LoginInterceptor;
//import org.springframework.context.annotation.Configuration;
//
//import org.springframework.web.bind.annotation.CrossOrigin;
//import org.springframework.web.servlet.HandlerInterceptor;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistration;
//import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//
//import java.util.ArrayList;
//import java.util.List;
//
//@Configuration
//public class InterceptorConfigurer  implements WebMvcConfigurer {
//
//    @Override
//    public void addInterceptors(InterceptorRegistry registry) {
//        HandlerInterceptor loginInterceptor=new LoginInterceptor();
//        InterceptorRegistration ir=registry.addInterceptor(loginInterceptor);
//
////         黑名单
//        ir.addPathPatterns("/**");
//
////        白名单
//        List<String> patterns=new ArrayList<>();
//        patterns.add("/user/**");
//        patterns.add("/error/**");
//        ir.excludePathPatterns(patterns);
//    }
//}
